package com.fastframework.error {
	import flash.text.TextField;

	/**
	 * @author colin
	 */
	final public class ErrorLog {
		private static var ins:ErrorLog;
		public static function instance():ErrorLog {
			ins ||=new ErrorLog(new SingletonBlocker());
			return ins;
		}
		private var txt:TextField;
		public function ErrorLog(p_key:SingletonBlocker) {
		}
		
		public function setView(txt:TextField):void{
			this.txt = txt;
		}
		public function log(e:Error):void{
			var str:String = (new Date().toString())+"::"+e.message;
			if(txt is TextField){
				txt.appendText(str);
			}else{
				trace(str);
			}
		}
	}
}
class SingletonBlocker{}